import * as types from "./mutations_types";

export default {
    show_loading: ({ commit }) => {
        return new Promise(resolve => {
            commit(types.SHOW_LOADING);
            resolve();
        });
    },

    hide_loading: ({ commit }) => {
        return new Promise(resolve => {
            commit(types.HIDE_LOADING);
            resolve();
        });
    },

    toast: ({ commit }, param) => {
        return new Promise(resolve => {
            commit(types.TOAST, param);
            resolve();
        });
    },

    ctrl_customer: ({ commit }, param) => {
        return new Promise(resolve => {
            commit(types.CTRL_CUSTOMER, param);
            resolve();
        });
    },

    ctrl_notice: ({ commit }, param) => {
        return new Promise(resolve => {
            commit(types.CTRL_NOTICE, param);
            resolve();
        });
    },

    ctrl_tabbar: ({ commit }, param) => {
        return new Promise(resolve => {
            commit(types.CTRL_TABBAR, param);
            resolve();
        });
    },

    user_data: ({ commit }, param) => {
        return new Promise(resolve => {
            commit(types.USER_DATA, param);
            resolve();
        });
    },

    header_data: ({ commit }, param) => {
        return new Promise(resolve => {
            commit(types.HEADER_DATA, param);
            resolve();
        });
    }
};
